import router from "@/router";
import { createPinia } from "pinia";
import { App } from "vue";
import piniaPluginPersistedState from "pinia-plugin-persistedstate";

import "element-plus/theme-chalk/index.css";

const store = createPinia().use(piniaPluginPersistedState);

const before = (cb: (instance: App<Element>) => void) => {
    const context = this;

    context.use(router).use(store);

    cb && cb(context);
};

export default before;
